package com.itheima.task;

import cn.hutool.core.date.DateUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;
@Component
public class PrintTimeTask {

    //从0秒开始 每5秒执行一次
    //@Scheduled(cron = "0/5 * * * * ?")
    public void printNow(){
        System.out.println(DateUtil.formatDateTime(new Date()));
    }
}
